local ma__yilie = fk.CreateSkill {
  name = "ma__yilie",
}

Fk:loadTranslationTable{
  ["ma__yilie"] = "毅烈",
  [":ma__yilie"] = "当你需要使用一张基本牌时，你可以视为使用之。若目标角色不为你，则此牌不可被抵消且结算后你失去1点体力，否则此技能本回合失效。",

  ["#ma__yilie"] = "毅烈：视为使用一张基本牌（目标不为你则须失去体力，为你则本回合此技能失效）",


  ["$ma__yilie1"] = "杀身以报陛下，臣之愿也！",
  ["$ma__yilie2"] = "杀敌建功，卫我家国！"
}

ma__yilie:addEffect("viewas", {
  pattern = ".|.|.|.|.|basic",
  prompt = "#ma__yilie",
  interaction = function(self, player)
    local all_names = Fk:getAllCardNames("b")
    local names = player:getViewAsCardNames(ma__yilie.name, all_names)
    if #names == 0 then return end
    return UI.CardNameBox { choices = names, all_choices = all_names }
  end,
  card_filter = Util.FalseFunc,
  before_use = function (self, player, use)
    local room = player.room
    local to = use.tos[1]
    if to ~= player then
      use.unoffsetableList = table.simpleClone(room.players)
    end
  end,
  view_as = function(self, player, cards)
    if not self.interaction.data then return end
    local card = Fk:cloneCard(self.interaction.data)
    card.skillName = ma__yilie.name
    return card
  end,
  after_use = function (self, player, use)
  if use.tos[1] ~= player then
    player.room:loseHp(player, 1, ma__yilie.name)
  else player.room:invalidateSkill(player, ma__yilie.name, "-turn")
  end
  end,
  --[[enabled_at_play = function(self, player)
    return #player:getCardIds("he") > player:usedSkillTimes(ma__yilie.name, Player.HistoryTurn) and
      #Fk:currentRoom().alive_players > 1
  end,]]
  enabled_at_response = function(self, player, response)
    return not response
  end,
})

return ma__yilie